import {request} from "@/api";
function attachUpload(file: any) {
    return request({
        method: 'post',
        url: "/common/upload",
        data: {file},
        config: {
            headers: {'Content-Type': 'multipart/form-data'}
        }
    });// 会返回一个url  上传的文件
}


// 请求个人信息获取头像
function personalInfomation() {
    return request( {
        method:'get',
        url:'/system/user/profile',
    })
}

// 编辑个人信息
function editUser(data:any) {
    return request({
        method: "put", url: '/frontend/jsUser', data
    })
}
//退出登录
 function outLogin() {
    return request({
        method:'post',
        url:'/logout',
        // data:user,
        // data:{
        //     username:username,
        //     password:password,
        // }
    })
}
// 积分明细
function getIntegration() {
    return request( {
        method:'get',
        url:`/mini/list`,
        data:{
            pageSize:100,
            pageNum:1,
        }
    })
}
// 查询积分兑换
function getIntegrationExchange() {
    return request( {
        method:'get',
        url:`/jsIntegral/exchange/list`,
    })
}
// 抽奖记录/
function LuckyDrawRecord() {
    return request( {
        method:'get',
        url:`jsActivityRecord/list`,
    })
}
export  {attachUpload,personalInfomation,editUser,outLogin,getIntegration,getIntegrationExchange,LuckyDrawRecord}